<?php
    function recent_cmts($num) {
        global $wpdb;
        $query = ("SELECT ID, post_title, comment_author, comment_id, comment_author_email, comment_date, comment_post_ID FROM  $wpdb->posts, $wpdb->comments WHERE $wpdb->posts.ID=$wpdb->comments.comment_post_ID AND $wpdb->comments.comment_approved = '1' AND $wpdb->comments.comment_type = '' AND comment_author != 'Andor' ORDER BY $wpdb->comments.comment_date DESC LIMIT $num");
        $result = mysql_query($query);
        while ($data = mysql_fetch_row($result)) {
            echo '<li class="recent-cmts">';
            echo '<img style="float: left; margin-right: 4px; padding: 1px; border: 1px solid #CCC;" src="http://www.gravatar.com/avatar.php?gravatar_id=';
            echo md5($data[4]);
            echo '&amp;size=24&amp;default=';
            echo bloginfo('template_url');
            echo '/images/default_24.gif';
            echo '" alt="';
            echo $data[2];
            echo '&#39;s Gravatar" height="24" width="24" />';
            echo '<div style="margin-left: 36px;"><a href="';
            echo get_permalink($data[0]);
            echo "#comment-$data[3]";
            echo '" title="';
            echo 'commented on &raquo; ';
            echo $data[1];
            echo '"><strong>';
            echo $data[2];
            echo '</strong></a><br/>';
            echo $data[5];
            echo '</div>';
            echo '</li>';
        }
    }
?>